virtualisation.oci-containers.containers.<name>.ports

Network ports to publish from the container to the outer host.

Valid formats:

Both hostPort and containerPort can be specified as a range of ports. When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. Example: 1234-1236:1234-1236/tcp

When specifying a range for hostPort only, the containerPort must not be a range. In this case, the container port is published somewhere within the specified hostPort range. Example: 1234-1236:1234/tcp

Publishing a port bypasses the NixOS firewall. If the port is not supposed to be shared on the network, make sure to publish the port to localhost. Example: 127.0.0.1:1234:1234

Refer to the Docker engine documentation for full details.

Type
list of string
Default
[ ]
Example
[
  "127.0.0.1:8080:9000"
]
Declared
<nixpkgs/nixos/modules/virtualisation/oci-containers.nix>